<script>
    // Device 家用电器类
    function Device(ford ,efficiency ){
        this.ford = ford;
        this.efficiency = efficiency
    }
    let device = new Device('220V','一级')
    console.log(device);


    // lamp 灯类
    function Lamp(color,ford,efficiency){
        this.color = color;
        this.ford = ford;
        this.efficiency = efficiency;

    }
    
    let lamp1 = new Lamp('白色','220V','一级');
    console.log(lamp1);
    Lamp.prototype.open = function(){
        return '天亮别开灯'
    }
    Lamp.prototype.close = function(){
        return '天黑请关灯'
    }
    console.log(lamp1.open());
    console.log(lamp1.close());
</script>